﻿<%@ Page Language="C#" MasterPageFile="../MasterPages/MedianamikModule.Master" AutoEventWireup="true" CodeBehind="LanguageList.aspx.cs" Inherits="Medianamik.UI.ConfigManagement.LanguageList" %>

<asp:Content ID="ContextMenuContent" ContentPlaceHolderID="ContextMenu" runat="server">
    <asp:HyperLink ID="lnkAddLanguage" runat="server" Target="addCultureWindow" CssClass="Action BtAjouter" NavigateUrl="/medianamik/modalwindows/AddCultureWindow.aspx" onclick="GetRadWindowManager().Open(null, 'addCultureWindow');" Text="<%$ Resources: Medianamik_ConfigurationManagement, AddLanguage %>" />
	<a href="#" class="Action BtAnnuler-Inactif"><asp:Localize runat="server" Text="<%$ Resources: Medianamik_Global,Cancel %>"></asp:Localize></a>
</asp:Content>

<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">
    <asp:UpdatePanel runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
        <ContentTemplate>
            <telerik:RadGrid runat="server" 
	                         ID="GridLanguages" 
	                         EnableEmbeddedSkins="false" 
	                         Skin="Medianamik" 
	                         AutoGenerateColumns="false" 
	                         OnRowDrop="GridLanguages_RowDrop"
	                         OnNeedDataSource="GridLanguages_NeedDataSource"
	                         OnItemDataBound="GridLanguages_ItemDataBound">
		        <MasterTableView DataKeyNames = "CultureName" >
			        <Columns>
				        <telerik:GridBoundColumn DataField="CultureInfo.DisplayName" HeaderText="<%$ Resources : Medianamik_ConfigurationManagement, Language %>"></telerik:GridBoundColumn>
				        <telerik:GridTemplateColumn HeaderText="Actif" HeaderStyle-Width="250px">
				            <ItemStyle CssClass="Actions" />
				            <ItemTemplate>
				                <asp:HiddenField ID="CultureName" runat="server" Value='<%#Eval("CultureName") %>' />
                                <table border="0" cellpadding="0" cellspacing="0" align="center">
                                    <tr>
                                        <td>
                                            <asp:Checkbox ID="ContentManagementActive" runat="server" Checked='<%#Eval("ContentManagementActive") %>' OnCheckedChanged="ActivityChanged" AutoPostBack="true" Text="<%$ Resources : Medianamik_ConfigurationManagement, ContentManagementActive %>" />
                                        </td>
                                        <td>
                                            <asp:Checkbox ID="MedianamikActive" runat="server" Checked='<%#Eval("MedianamikActive") %>' OnCheckedChanged="ActivityChanged" AutoPostBack="true" Text="<%$ Resources : Medianamik_ConfigurationManagement, MedianamikActive %>" />
                                        </td>
                                    </tr>
                                </table>
        				        
				            </ItemTemplate>
				        </telerik:GridTemplateColumn>
			        </Columns>
			        <NoRecordsTemplate>
			            <asp:Literal ID="NoRecords" runat="server" Text="<%$ Resources: Medianamik_ContentManagement, NoRecordsToDisplay %>" />
			        </NoRecordsTemplate>
		        </MasterTableView>
		        <ClientSettings EnableRowHoverStyle="true" AllowRowsDragDrop="true" >
		            <Selecting EnableDragToSelectRows="true" AllowRowSelect="true" />
		            <ClientEvents />
		        </ClientSettings>
	        </telerik:RadGrid>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="ExternalContent" ContentPlaceHolderID="ExternalContentHolder" runat="server">
    <telerik:RadScriptBlock runat="server" ID="scriptBlock">

        <script type="text/javascript">
            //<![CDATA[

            function modalWindowCallback(radWindow, returnValue)
            {
                if (returnValue) {
                    var argument = returnValue.get_argument();
                    if(argument)
                        __doPostBack('<%= lnkAddLanguage.ClientID %>', argument);
                }
            }

            function confirmActivation()
            {
                return confirm('<%=Message %>');
            }

            //]]>
        </script>

    </telerik:RadScriptBlock>
</asp:Content>